<template>
	<view style="display: flex;flex-direction: column;">
		<view class="nuoyu-box">
			<view class="nuoyu-header">
				<view class="nuoyu-header-text" :style="'--main-bg-color:'+themeColor.main_color">
					<view>
						当前会员
					</view> 
					<view style="display: flex;
    justify-content: center;border: 1rpx solid #584c00;padding: 8rpx 12rpx;background: linear-gradient(to right, #868686,#584c00);color:white;border-radius: 8rpx;width: 140rpx;">
						黑金卡
					</view>
				</view>
			</view>
			<div class="nuoyu-member" style="color:#584c00">
				尊贵的黑金卡用户,愿黑金的闪耀能照亮您的事业和前程
			</div>
		</view>
		
		<nuoyu-member :main_color="themeColor.main_color" :memberVipList="memberVipList"></nuoyu-member>
	</view>
</template>

<script>
	 
	export default {
		data() {
			return {
				themeColor:'',
				wechatConfig:'',
				balanceList:[],
				userInfo:'',
				memberVipList:[]
			};
		},
		onLoad() {
		
			this.getMemberVip();
			this.getH5Login();
			setTimeout(()=>{
				this.themeColor = this.$store.state.themeConfig || uni.getStorageSync('themeConfig')
				this.wechatConfig = this.$store.state.wechatConfig ||  uni.getStorageSync('wechatConfig')
			},500)
		},
		methods:{
			getMemberVip(){
				this.tui.request("/basic-capi/getMemberVip/list", "get",).then((res) => {
					this.memberVipList = res.data.list
					this.memberVipList.forEach((item,index)=>{
						item.level_logo = this.$store.state.wechatConfig.tencent‌Domain + item.level_logo
					})
				}).catch((res) => {
					console.log(res)
				})
			},
			getH5Login(){
				this.tui.request("/basic-capi/h5LoginRefresh", "post", {
					openid:uni.getStorageSync("userInfo")['openid']
				}).then((res) => {
					uni.setStorageSync('userInfo',res.data.userInfo)
					this.userInfo = res.data.userInfo
				}).catch((res) => {
					console.log(res)
				})
			},
			
		}
	}
</script>


<style lang="scss" scoped>
	.nuoyu-box{
		margin:20rpx 20rpx;
		display: flex;
		flex-direction: column;
		gap: 20rpx;
		.nuoyu-header{
			background: #fff;
			
			padding: 15px 10px 0 0px;
			.nuoyu-header-text{
				// padding: 15px 10px 0 20px;
				// height: 40rpx;
				display: flex;
				align-items: center;
				gap: 12rpx;
				font-size: 32rpx;
				color: #505050;
				font-weight: 700;
				padding-left: 10px;
				border-left: 6rpx solid var(--main-bg-color);
			}
			
		}
		.nuoyu-member{
			color: #505050;
			margin-left:16rpx;
			
		}
	}
	
</style>